﻿/*
 * Erstellt mit SharpDevelop.
 * Benutzer: Matthias
 * Datum: 10/27/2013
 * Zeit: 20:20
 * 
 * Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
 */
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;

namespace Drag_and_Drop
{
	/// <summary>
	/// Interaction logic for Circle.xaml
	/// </summary>
	public partial class Circle : UserControl
	{
		public Circle()
		{
			InitializeComponent();
		}
		
		public Circle(Circle c)
		{
			InitializeComponent();
			this.circleUI.Height = c.circleUI.Height;
			this.circleUI.Width = c.circleUI.Width;
			this.circleUI.Fill = c.circleUI.Fill;
		}

		protected override void OnMouseMove(MouseEventArgs e)
		{
			base.OnMouseMove(e);
			if (e.LeftButton == MouseButtonState.Pressed)
			{
				//Daten in ein DataObject packen
				DataObject data = new DataObject();
				data.SetData(DataFormats.StringFormat, circleUI.Fill.ToString());
				data.SetData("Double", circleUI.Height);
				data.SetData("Object", this);

				//Drag and Drop initialisieren
				DragDrop.DoDragDrop(this, data, DragDropEffects.Copy | DragDropEffects.Move);
			}
		}
	}
}